<!DOCTYPE html>
<html >
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>定位</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        div{
            margin: 10px;
            display: inline-block;
            width: 200px;
            height: 200px;
            background-color: red;
        }
        .box1{
            background-color: blue;
            position: relative;
        }
        .box1:hover{
            top: 10px;
            left: 10px;
        }
    </style>
</head>
<body>
    <div> </div>
    <div class="box1"></div>
    <div> </div>
</body>
</html>